package com.yx.changdao.generate.model;

import com.yx.changdao.generate.utils.CodeGenerateUtils;
import org.apache.commons.lang3.StringUtils;

/**
 * @Description: <br />
 * 数据字典参数实体
 * <p>
 * <br />
 * @Auther: Zhangjiashun
 * @create 2019/12/5 16:15
 */
public class DataDictParam {

    /**
     * 数据库名
     */
    public static String DB_NAME;


    /**
     * 数据库连接的地址
     */
    public String URL;

    /**
     * 用户名
     */
    public String user;

    /**
     * 密码
     */
    public String password;


    /**
     * 生成文件名
     */
    private String createFileName;

    public String getURL() {
        return URL;
    }

    public void setURL(String URL) {
        if (StringUtils.isBlank(DB_NAME)) {
            System.err.println("设置连接前请先设置数据库名!");
            return;
        }
        this.URL = CodeGenerateUtils.createDBLink(URL + "/" + DB_NAME);
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCreateFileName() {
        return createFileName;
    }

    public void setCreateFileName(String createFileName) {
        this.createFileName = createFileName;
    }


    public String getDBName() {
        return DB_NAME;
    }

    public void setDBName(String DBName) {
        DataDictParam.DB_NAME = DBName;
    }
}

